package DesignPrinciple.DepInversion;
import Utils.Util;

public class Computer {
    private KingStonMemory memory;
    private XiJieHardDisk hardDisk;
    private IntelCPU cpu;

    public KingStonMemory getMemory() {
        return memory;
    }

    public void setMemory(KingStonMemory memory) {
        this.memory = memory;
    }

    public XiJieHardDisk getHardDisk() {
        return hardDisk;
    }

    public void setHardDisk(XiJieHardDisk hardDisk) {
        this.hardDisk = hardDisk;
    }

    public IntelCPU getCpu() {
        return cpu;
    }

    public void setCpu(IntelCPU cpu) {
        this.cpu = cpu;
    }

    public void run(){
        System.out.println("运行计算机");
        String data = hardDisk.get();
        Util.divide();
        cpu.run();
        Util.divide();
        memory.save();
    }
}
